package com.dkd.applet.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dkd.applet.domain.Channel;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ChannelMapper extends BaseMapper<Channel> {

    @Select("select * from tb_channel where inner_code=#{innerCode}")
    @Results(id = "channelMap", value = {
            @Result(property = "channelId", column = "channel_id"),
            @Result(property = "skuId", column = "sku_id"),
            @Result(property = "sku", column = "sku_id", one = @One(select = "com.dkd.applet.mapper.SkuMapper.selectById"))
    })
    List<Channel> getChannelsByInnerCode(String innerCode);
}
